package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzDongtaiMapper;
import com.ruoyi.system.domain.DzDongtai;
import com.ruoyi.system.service.IDzDongtaiService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 实时动态Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-16
 */
@Service
public class DzDongtaiServiceImpl implements IDzDongtaiService 
{
    @Autowired
    private DzDongtaiMapper dzDongtaiMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询实时动态
     * 
     * @param ssId 实时动态主键
     * @return 实时动态
     */
    @Override
    public DzDongtai selectDzDongtaiBySsId(Long ssId)
    {
        return dzDongtaiMapper.selectDzDongtaiBySsId(ssId);
    }

    /**
     * 查询实时动态列表
     * 
     * @param dzDongtai 实时动态
     * @return 实时动态
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzDongtai> selectDzDongtaiList(DzDongtai dzDongtai)
    {

        return dzDongtaiMapper.selectDzDongtaiList(dzDongtai);
    }

    @Override
    public List<DzDongtai> selectDzDongtaiListWeb(DzDongtai dzDongtai)
    {
        return dzDongtaiMapper.selectDzDongtaiList(dzDongtai);
    }

    /**
     * 新增实时动态
     * 
     * @param dzDongtai 实时动态
     * @return 结果
     */
    @Override
    public int insertDzDongtai(DzDongtai dzDongtai)
    {
        dzDongtai.setCreateTime(DateUtils.getNowDate());
        return dzDongtaiMapper.insertDzDongtai(dzDongtai);
    }

    /**
     * 修改实时动态
     * 
     * @param dzDongtai 实时动态
     * @return 结果
     */
    @Override
    public int updateDzDongtai(DzDongtai dzDongtai)
    {
        return dzDongtaiMapper.updateDzDongtai(dzDongtai);
    }

    /**
     * 批量删除实时动态
     * 
     * @param ssIds 需要删除的实时动态主键
     * @return 结果
     */
    @Override
    public int deleteDzDongtaiBySsIds(Long[] ssIds)
    {
        return dzDongtaiMapper.deleteDzDongtaiBySsIds(ssIds);
    }

    /**
     * 删除实时动态信息
     * 
     * @param ssId 实时动态主键
     * @return 结果
     */
    @Override
    public int deleteDzDongtaiBySsId(Long ssId)
    {
        return dzDongtaiMapper.deleteDzDongtaiBySsId(ssId);
    }
}
